---
import { SITE, OPEN_GRAPH, Frontmatter } from '../config';

export interface Props {
	frontmatter: Frontmatter;
	canonicalUrl: URL;
}

const { frontmatter, canonicalUrl } = Astro.props as Props;
const formattedContentTitle = `${frontmatter.title} 🚀 ${SITE.title}`;
const imageSrc = frontmatter.image?.src ?? OPEN_GRAPH.image.src;
const canonicalImageSrc = new URL(imageSrc, Astro.site);
const imageAlt = frontmatter.image?.alt ?? OPEN_GRAPH.image.alt;
---

<!-- Page Metadata -->
<link rel="canonical" href={canonicalUrl} />

<meta name="title" content="ElectroDB">
<meta name="description" content="Model, query, and share typesafe DynamoDB single-table design with ElectroDB">
<meta property="og:title" content="ElectroDB">
<meta property="og:description" content="Model, query, and share typesafe DynamoDB single-table design with ElectroDB.">
<meta property="og:image" content="https://electrodb.dev/social.jpg">
<meta property="og:url" content="https://electrodb.dev">
<meta name="twitter:card" content="summary_large_image">
<meta property="og:site_name" content="ElectroDB">
<meta name="twitter:image:alt" content="Data modeling, single-table design, cost savings">
<meta name="twitter:creator" content="@tinkertamper">

<!-- HTML Meta Tags -->
<meta name="title" content="ElectroDB">
<meta name="description" content="Model, query, and share typesafe DynamoDB single-table design with ElectroDB">

<!-- Facebook Meta Tags -->
<meta property="og:url" content="https://electrodb.dev">
<meta property="og:type" content="website">
<meta property="og:title" content="ElectroDB">
<meta property="og:description" content="Model, query, and share typesafe DynamoDB single-table design with ElectroDB">
<meta property="og:image" content="https://electrodb.dev/social.jpg">

<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta property="twitter:domain" content="electrodb.dev">
<meta property="twitter:url" content="https://electrodb.dev">
<meta name="twitter:title" content="ElectroDB">
<meta name="twitter:description" content="Model, query, and share typesafe DynamoDB single-table design with ElectroDB">
<meta name="twitter:image" content="https://electrodb.dev/social.jpg">

<!--
  TODO: Add json+ld data, maybe https://schema.org/APIReference makes sense?
  Docs: https://developers.google.com/search/docs/advanced/structured-data/intro-structured-data
  https://www.npmjs.com/package/schema-dts seems like a great resource for implementing this.
  Even better, there's a React component that integrates with `schema-dts`: https://github.com/google/react-schemaorg
-->
